package com.hjxy.codetools.service;

import com.hjxy.codetools.dao.PayOrderMapper;
import com.hjxy.codetools.dto.PayOrderDto;
import com.hjxy.codetools.interfa.PayOrderServiceInterface;
import com.hjxy.codetools.model.PayOrderModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional(isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
public class PayOrderService implements PayOrderServiceInterface {

    @Autowired
    PayOrderMapper payOrderMapper;

    @Override
    public int insertPayOrder(PayOrderModel payOrderModel) throws Exception {
        return payOrderMapper.insertPayOrder(payOrderModel);
    }

    @Override
    public List<PayOrderModel> getPayOrderInfo(Map map) throws Exception {
        return payOrderMapper.getPayOrderInfo(map);
    }

    @Override
    public List<PayOrderDto> getOrdersInfo(Map map) throws Exception {
        return payOrderMapper.getOrdersInfo(map);
    }

    @Override
    public int upPayOrder(Map map) throws Exception {
        return payOrderMapper.upPayOrder(map);
    }

    @Override
    public int getTotalNum(Map map) throws Exception {
        return payOrderMapper.getTotalNum(map);
    }

    @Override
    public int getTotalPayNum(Map map) throws Exception {
        return payOrderMapper.getTotalPayNum(map);
    }
}
